using System; 
using System.Text; 
using System.Data;
using System.Data.SqlClient;
using System.Data.Common;
using System.Collections;
using System.Collections.Generic;
using System.ComponentModel;
using System.Configuration; 
using System.Xml; 
using System.Xml.Serialization;
using SubSonic; 
using SubSonic.Utilities;

namespace LMSData
{
	/// <summary>
	/// Strongly-typed collection for the UserProfile class.
	/// </summary>
	[Serializable]
	public partial class UserProfileCollection : ActiveList<UserProfile, UserProfileCollection> 
	{	   
		public UserProfileCollection() {}

	}

	/// <summary>
	/// This is an ActiveRecord class which wraps the UserProfile table.
	/// </summary>
	[Serializable]
	public partial class UserProfile : ActiveRecord<UserProfile>
	{
		#region .ctors and Default Settings
		
		public UserProfile()
		{
		  SetSQLProps();
		  InitSetDefaults();
		  MarkNew();
		}

		
		private void InitSetDefaults() { SetDefaults(); }

		
		public UserProfile(bool useDatabaseDefaults)
		{
			SetSQLProps();
			if(useDatabaseDefaults)
				ForceDefaults();
			MarkNew();
		}

		public UserProfile(object keyID)
		{
			SetSQLProps();
			InitSetDefaults();
			LoadByKey(keyID);
		}

		 
		public UserProfile(string columnName, object columnValue)
		{
			SetSQLProps();
			InitSetDefaults();
			LoadByParam(columnName,columnValue);
		}

		
		protected static void SetSQLProps() { GetTableSchema(); }

		
		#endregion
		
		#region Schema and Query Accessor
		public static Query CreateQuery() { return new Query(Schema); }

		
		public static TableSchema.Table Schema
		{
			get
			{
				if (BaseSchema == null)
					SetSQLProps();
				return BaseSchema;
			}

		}

		
		private static void GetTableSchema() 
		{
			if(!IsSchemaInitialized)
			{
				//Schema declaration
				TableSchema.Table schema = new TableSchema.Table("UserProfile", TableType.Table, DataService.GetInstance("LMS"));
				schema.Columns = new TableSchema.TableColumnCollection();
				schema.SchemaName = @"dbo";
				//columns
				
				TableSchema.TableColumn colvarUserProfileID = new TableSchema.TableColumn(schema);
				colvarUserProfileID.ColumnName = "UserProfileID";
				colvarUserProfileID.DataType = DbType.Int32;
				colvarUserProfileID.MaxLength = 0;
				colvarUserProfileID.AutoIncrement = true;
				colvarUserProfileID.IsNullable = false;
				colvarUserProfileID.IsPrimaryKey = true;
				colvarUserProfileID.IsForeignKey = false;
				colvarUserProfileID.IsReadOnly = false;
				colvarUserProfileID.DefaultSetting = @"";
				colvarUserProfileID.ForeignKeyTableName = "";
				schema.Columns.Add(colvarUserProfileID);
				
				TableSchema.TableColumn colvarUserID = new TableSchema.TableColumn(schema);
				colvarUserID.ColumnName = "UserID";
				colvarUserID.DataType = DbType.Int32;
				colvarUserID.MaxLength = 0;
				colvarUserID.AutoIncrement = false;
				colvarUserID.IsNullable = false;
				colvarUserID.IsPrimaryKey = false;
				colvarUserID.IsForeignKey = true;
				colvarUserID.IsReadOnly = false;
				colvarUserID.DefaultSetting = @"";
				
					colvarUserID.ForeignKeyTableName = "User";
				schema.Columns.Add(colvarUserID);
				
				TableSchema.TableColumn colvarFirstName = new TableSchema.TableColumn(schema);
				colvarFirstName.ColumnName = "FirstName";
				colvarFirstName.DataType = DbType.String;
				colvarFirstName.MaxLength = 255;
				colvarFirstName.AutoIncrement = false;
				colvarFirstName.IsNullable = true;
				colvarFirstName.IsPrimaryKey = false;
				colvarFirstName.IsForeignKey = false;
				colvarFirstName.IsReadOnly = false;
				colvarFirstName.DefaultSetting = @"";
				colvarFirstName.ForeignKeyTableName = "";
				schema.Columns.Add(colvarFirstName);
				
				TableSchema.TableColumn colvarMiddleName = new TableSchema.TableColumn(schema);
				colvarMiddleName.ColumnName = "MiddleName";
				colvarMiddleName.DataType = DbType.String;
				colvarMiddleName.MaxLength = 255;
				colvarMiddleName.AutoIncrement = false;
				colvarMiddleName.IsNullable = true;
				colvarMiddleName.IsPrimaryKey = false;
				colvarMiddleName.IsForeignKey = false;
				colvarMiddleName.IsReadOnly = false;
				colvarMiddleName.DefaultSetting = @"";
				colvarMiddleName.ForeignKeyTableName = "";
				schema.Columns.Add(colvarMiddleName);
				
				TableSchema.TableColumn colvarLastName = new TableSchema.TableColumn(schema);
				colvarLastName.ColumnName = "LastName";
				colvarLastName.DataType = DbType.String;
				colvarLastName.MaxLength = 255;
				colvarLastName.AutoIncrement = false;
				colvarLastName.IsNullable = true;
				colvarLastName.IsPrimaryKey = false;
				colvarLastName.IsForeignKey = false;
				colvarLastName.IsReadOnly = false;
				colvarLastName.DefaultSetting = @"";
				colvarLastName.ForeignKeyTableName = "";
				schema.Columns.Add(colvarLastName);
				
				TableSchema.TableColumn colvarAddress = new TableSchema.TableColumn(schema);
				colvarAddress.ColumnName = "Address";
				colvarAddress.DataType = DbType.String;
				colvarAddress.MaxLength = 255;
				colvarAddress.AutoIncrement = false;
				colvarAddress.IsNullable = true;
				colvarAddress.IsPrimaryKey = false;
				colvarAddress.IsForeignKey = false;
				colvarAddress.IsReadOnly = false;
				colvarAddress.DefaultSetting = @"";
				colvarAddress.ForeignKeyTableName = "";
				schema.Columns.Add(colvarAddress);
				
				TableSchema.TableColumn colvarCity = new TableSchema.TableColumn(schema);
				colvarCity.ColumnName = "City";
				colvarCity.DataType = DbType.String;
				colvarCity.MaxLength = 255;
				colvarCity.AutoIncrement = false;
				colvarCity.IsNullable = true;
				colvarCity.IsPrimaryKey = false;
				colvarCity.IsForeignKey = false;
				colvarCity.IsReadOnly = false;
				colvarCity.DefaultSetting = @"";
				colvarCity.ForeignKeyTableName = "";
				schema.Columns.Add(colvarCity);
				
				TableSchema.TableColumn colvarStateProvince = new TableSchema.TableColumn(schema);
				colvarStateProvince.ColumnName = "StateProvince";
				colvarStateProvince.DataType = DbType.String;
				colvarStateProvince.MaxLength = 255;
				colvarStateProvince.AutoIncrement = false;
				colvarStateProvince.IsNullable = true;
				colvarStateProvince.IsPrimaryKey = false;
				colvarStateProvince.IsForeignKey = false;
				colvarStateProvince.IsReadOnly = false;
				colvarStateProvince.DefaultSetting = @"";
				colvarStateProvince.ForeignKeyTableName = "";
				schema.Columns.Add(colvarStateProvince);
				
				TableSchema.TableColumn colvarCountry = new TableSchema.TableColumn(schema);
				colvarCountry.ColumnName = "Country";
				colvarCountry.DataType = DbType.String;
				colvarCountry.MaxLength = 255;
				colvarCountry.AutoIncrement = false;
				colvarCountry.IsNullable = true;
				colvarCountry.IsPrimaryKey = false;
				colvarCountry.IsForeignKey = false;
				colvarCountry.IsReadOnly = false;
				colvarCountry.DefaultSetting = @"";
				colvarCountry.ForeignKeyTableName = "";
				schema.Columns.Add(colvarCountry);
				
				TableSchema.TableColumn colvarPostalCode = new TableSchema.TableColumn(schema);
				colvarPostalCode.ColumnName = "PostalCode";
				colvarPostalCode.DataType = DbType.String;
				colvarPostalCode.MaxLength = 255;
				colvarPostalCode.AutoIncrement = false;
				colvarPostalCode.IsNullable = true;
				colvarPostalCode.IsPrimaryKey = false;
				colvarPostalCode.IsForeignKey = false;
				colvarPostalCode.IsReadOnly = false;
				colvarPostalCode.DefaultSetting = @"";
				colvarPostalCode.ForeignKeyTableName = "";
				schema.Columns.Add(colvarPostalCode);
				
				TableSchema.TableColumn colvarTitle = new TableSchema.TableColumn(schema);
				colvarTitle.ColumnName = "Title";
				colvarTitle.DataType = DbType.String;
				colvarTitle.MaxLength = 255;
				colvarTitle.AutoIncrement = false;
				colvarTitle.IsNullable = true;
				colvarTitle.IsPrimaryKey = false;
				colvarTitle.IsForeignKey = false;
				colvarTitle.IsReadOnly = false;
				colvarTitle.DefaultSetting = @"";
				colvarTitle.ForeignKeyTableName = "";
				schema.Columns.Add(colvarTitle);
				
				TableSchema.TableColumn colvarJobCode = new TableSchema.TableColumn(schema);
				colvarJobCode.ColumnName = "JobCode";
				colvarJobCode.DataType = DbType.String;
				colvarJobCode.MaxLength = 255;
				colvarJobCode.AutoIncrement = false;
				colvarJobCode.IsNullable = true;
				colvarJobCode.IsPrimaryKey = false;
				colvarJobCode.IsForeignKey = false;
				colvarJobCode.IsReadOnly = false;
				colvarJobCode.DefaultSetting = @"";
				colvarJobCode.ForeignKeyTableName = "";
				schema.Columns.Add(colvarJobCode);
				
				TableSchema.TableColumn colvarCostCenter = new TableSchema.TableColumn(schema);
				colvarCostCenter.ColumnName = "CostCenter";
				colvarCostCenter.DataType = DbType.String;
				colvarCostCenter.MaxLength = 255;
				colvarCostCenter.AutoIncrement = false;
				colvarCostCenter.IsNullable = true;
				colvarCostCenter.IsPrimaryKey = false;
				colvarCostCenter.IsForeignKey = false;
				colvarCostCenter.IsReadOnly = false;
				colvarCostCenter.DefaultSetting = @"";
				colvarCostCenter.ForeignKeyTableName = "";
				schema.Columns.Add(colvarCostCenter);
				
				TableSchema.TableColumn colvarUniqueID = new TableSchema.TableColumn(schema);
				colvarUniqueID.ColumnName = "UniqueID";
				colvarUniqueID.DataType = DbType.String;
				colvarUniqueID.MaxLength = 255;
				colvarUniqueID.AutoIncrement = false;
				colvarUniqueID.IsNullable = true;
				colvarUniqueID.IsPrimaryKey = false;
				colvarUniqueID.IsForeignKey = false;
				colvarUniqueID.IsReadOnly = false;
				colvarUniqueID.DefaultSetting = @"";
				colvarUniqueID.ForeignKeyTableName = "";
				schema.Columns.Add(colvarUniqueID);
				
				TableSchema.TableColumn colvarTelephone = new TableSchema.TableColumn(schema);
				colvarTelephone.ColumnName = "Telephone";
				colvarTelephone.DataType = DbType.String;
				colvarTelephone.MaxLength = 255;
				colvarTelephone.AutoIncrement = false;
				colvarTelephone.IsNullable = true;
				colvarTelephone.IsPrimaryKey = false;
				colvarTelephone.IsForeignKey = false;
				colvarTelephone.IsReadOnly = false;
				colvarTelephone.DefaultSetting = @"";
				colvarTelephone.ForeignKeyTableName = "";
				schema.Columns.Add(colvarTelephone);
				
				TableSchema.TableColumn colvarCellPhone = new TableSchema.TableColumn(schema);
				colvarCellPhone.ColumnName = "CellPhone";
				colvarCellPhone.DataType = DbType.String;
				colvarCellPhone.MaxLength = 255;
				colvarCellPhone.AutoIncrement = false;
				colvarCellPhone.IsNullable = true;
				colvarCellPhone.IsPrimaryKey = false;
				colvarCellPhone.IsForeignKey = false;
				colvarCellPhone.IsReadOnly = false;
				colvarCellPhone.DefaultSetting = @"";
				colvarCellPhone.ForeignKeyTableName = "";
				schema.Columns.Add(colvarCellPhone);
				
				TableSchema.TableColumn colvarEmail = new TableSchema.TableColumn(schema);
				colvarEmail.ColumnName = "Email";
				colvarEmail.DataType = DbType.String;
				colvarEmail.MaxLength = 255;
				colvarEmail.AutoIncrement = false;
				colvarEmail.IsNullable = true;
				colvarEmail.IsPrimaryKey = false;
				colvarEmail.IsForeignKey = false;
				colvarEmail.IsReadOnly = false;
				colvarEmail.DefaultSetting = @"";
				colvarEmail.ForeignKeyTableName = "";
				schema.Columns.Add(colvarEmail);
				
				TableSchema.TableColumn colvarLastUpdatedDate = new TableSchema.TableColumn(schema);
				colvarLastUpdatedDate.ColumnName = "LastUpdatedDate";
				colvarLastUpdatedDate.DataType = DbType.DateTime;
				colvarLastUpdatedDate.MaxLength = 0;
				colvarLastUpdatedDate.AutoIncrement = false;
				colvarLastUpdatedDate.IsNullable = true;
				colvarLastUpdatedDate.IsPrimaryKey = false;
				colvarLastUpdatedDate.IsForeignKey = false;
				colvarLastUpdatedDate.IsReadOnly = false;
				colvarLastUpdatedDate.DefaultSetting = @"";
				colvarLastUpdatedDate.ForeignKeyTableName = "";
				schema.Columns.Add(colvarLastUpdatedDate);
				
				TableSchema.TableColumn colvarCreatedOn = new TableSchema.TableColumn(schema);
				colvarCreatedOn.ColumnName = "CreatedOn";
				colvarCreatedOn.DataType = DbType.DateTime;
				colvarCreatedOn.MaxLength = 0;
				colvarCreatedOn.AutoIncrement = false;
				colvarCreatedOn.IsNullable = true;
				colvarCreatedOn.IsPrimaryKey = false;
				colvarCreatedOn.IsForeignKey = false;
				colvarCreatedOn.IsReadOnly = false;
				colvarCreatedOn.DefaultSetting = @"";
				colvarCreatedOn.ForeignKeyTableName = "";
				schema.Columns.Add(colvarCreatedOn);
				
				TableSchema.TableColumn colvarCreatedBy = new TableSchema.TableColumn(schema);
				colvarCreatedBy.ColumnName = "CreatedBy";
				colvarCreatedBy.DataType = DbType.String;
				colvarCreatedBy.MaxLength = 50;
				colvarCreatedBy.AutoIncrement = false;
				colvarCreatedBy.IsNullable = true;
				colvarCreatedBy.IsPrimaryKey = false;
				colvarCreatedBy.IsForeignKey = false;
				colvarCreatedBy.IsReadOnly = false;
				colvarCreatedBy.DefaultSetting = @"";
				colvarCreatedBy.ForeignKeyTableName = "";
				schema.Columns.Add(colvarCreatedBy);
				
				TableSchema.TableColumn colvarModifiedOn = new TableSchema.TableColumn(schema);
				colvarModifiedOn.ColumnName = "ModifiedOn";
				colvarModifiedOn.DataType = DbType.DateTime;
				colvarModifiedOn.MaxLength = 0;
				colvarModifiedOn.AutoIncrement = false;
				colvarModifiedOn.IsNullable = true;
				colvarModifiedOn.IsPrimaryKey = false;
				colvarModifiedOn.IsForeignKey = false;
				colvarModifiedOn.IsReadOnly = false;
				colvarModifiedOn.DefaultSetting = @"";
				colvarModifiedOn.ForeignKeyTableName = "";
				schema.Columns.Add(colvarModifiedOn);
				
				TableSchema.TableColumn colvarModifiedBy = new TableSchema.TableColumn(schema);
				colvarModifiedBy.ColumnName = "ModifiedBy";
				colvarModifiedBy.DataType = DbType.String;
				colvarModifiedBy.MaxLength = 50;
				colvarModifiedBy.AutoIncrement = false;
				colvarModifiedBy.IsNullable = true;
				colvarModifiedBy.IsPrimaryKey = false;
				colvarModifiedBy.IsForeignKey = false;
				colvarModifiedBy.IsReadOnly = false;
				colvarModifiedBy.DefaultSetting = @"";
				colvarModifiedBy.ForeignKeyTableName = "";
				schema.Columns.Add(colvarModifiedBy);
				
				TableSchema.TableColumn colvarIsDeleted = new TableSchema.TableColumn(schema);
				colvarIsDeleted.ColumnName = "IsDeleted";
				colvarIsDeleted.DataType = DbType.Boolean;
				colvarIsDeleted.MaxLength = 0;
				colvarIsDeleted.AutoIncrement = false;
				colvarIsDeleted.IsNullable = false;
				colvarIsDeleted.IsPrimaryKey = false;
				colvarIsDeleted.IsForeignKey = false;
				colvarIsDeleted.IsReadOnly = false;
				
						colvarIsDeleted.DefaultSetting = @"((0))";
				colvarIsDeleted.ForeignKeyTableName = "";
				schema.Columns.Add(colvarIsDeleted);
				
				BaseSchema = schema;
				//add this schema to the provider
				//so we can query it later
				DataService.Providers["LMS"].AddSchema("UserProfile",schema);
			}

		}

		#endregion
		
		#region Props
		
		  
		[XmlAttribute("UserProfileID")]
		public int UserProfileID 
		{
			get { return GetColumnValue<int>("UserProfileID"); }

			set { SetColumnValue("UserProfileID", value); }

		}

		  
		[XmlAttribute("UserID")]
		public int UserID 
		{
			get { return GetColumnValue<int>("UserID"); }

			set { SetColumnValue("UserID", value); }

		}

		  
		[XmlAttribute("FirstName")]
		public string FirstName 
		{
			get { return GetColumnValue<string>("FirstName"); }

			set { SetColumnValue("FirstName", value); }

		}

		  
		[XmlAttribute("MiddleName")]
		public string MiddleName 
		{
			get { return GetColumnValue<string>("MiddleName"); }

			set { SetColumnValue("MiddleName", value); }

		}

		  
		[XmlAttribute("LastName")]
		public string LastName 
		{
			get { return GetColumnValue<string>("LastName"); }

			set { SetColumnValue("LastName", value); }

		}

		  
		[XmlAttribute("Address")]
		public string Address 
		{
			get { return GetColumnValue<string>("Address"); }

			set { SetColumnValue("Address", value); }

		}

		  
		[XmlAttribute("City")]
		public string City 
		{
			get { return GetColumnValue<string>("City"); }

			set { SetColumnValue("City", value); }

		}

		  
		[XmlAttribute("StateProvince")]
		public string StateProvince 
		{
			get { return GetColumnValue<string>("StateProvince"); }

			set { SetColumnValue("StateProvince", value); }

		}

		  
		[XmlAttribute("Country")]
		public string Country 
		{
			get { return GetColumnValue<string>("Country"); }

			set { SetColumnValue("Country", value); }

		}

		  
		[XmlAttribute("PostalCode")]
		public string PostalCode 
		{
			get { return GetColumnValue<string>("PostalCode"); }

			set { SetColumnValue("PostalCode", value); }

		}

		  
		[XmlAttribute("Title")]
		public string Title 
		{
			get { return GetColumnValue<string>("Title"); }

			set { SetColumnValue("Title", value); }

		}

		  
		[XmlAttribute("JobCode")]
		public string JobCode 
		{
			get { return GetColumnValue<string>("JobCode"); }

			set { SetColumnValue("JobCode", value); }

		}

		  
		[XmlAttribute("CostCenter")]
		public string CostCenter 
		{
			get { return GetColumnValue<string>("CostCenter"); }

			set { SetColumnValue("CostCenter", value); }

		}

		  
		[XmlAttribute("UniqueID")]
		public string UniqueID 
		{
			get { return GetColumnValue<string>("UniqueID"); }

			set { SetColumnValue("UniqueID", value); }

		}

		  
		[XmlAttribute("Telephone")]
		public string Telephone 
		{
			get { return GetColumnValue<string>("Telephone"); }

			set { SetColumnValue("Telephone", value); }

		}

		  
		[XmlAttribute("CellPhone")]
		public string CellPhone 
		{
			get { return GetColumnValue<string>("CellPhone"); }

			set { SetColumnValue("CellPhone", value); }

		}

		  
		[XmlAttribute("Email")]
		public string Email 
		{
			get { return GetColumnValue<string>("Email"); }

			set { SetColumnValue("Email", value); }

		}

		  
		[XmlAttribute("LastUpdatedDate")]
		public DateTime? LastUpdatedDate 
		{
			get { return GetColumnValue<DateTime?>("LastUpdatedDate"); }

			set { SetColumnValue("LastUpdatedDate", value); }

		}

		  
		[XmlAttribute("CreatedOn")]
		public DateTime? CreatedOn 
		{
			get { return GetColumnValue<DateTime?>("CreatedOn"); }

			set { SetColumnValue("CreatedOn", value); }

		}

		  
		[XmlAttribute("CreatedBy")]
		public string CreatedBy 
		{
			get { return GetColumnValue<string>("CreatedBy"); }

			set { SetColumnValue("CreatedBy", value); }

		}

		  
		[XmlAttribute("ModifiedOn")]
		public DateTime? ModifiedOn 
		{
			get { return GetColumnValue<DateTime?>("ModifiedOn"); }

			set { SetColumnValue("ModifiedOn", value); }

		}

		  
		[XmlAttribute("ModifiedBy")]
		public string ModifiedBy 
		{
			get { return GetColumnValue<string>("ModifiedBy"); }

			set { SetColumnValue("ModifiedBy", value); }

		}

		  
		[XmlAttribute("IsDeleted")]
		public bool IsDeleted 
		{
			get { return GetColumnValue<bool>("IsDeleted"); }

			set { SetColumnValue("IsDeleted", value); }

		}

		
		#endregion
		
		
			
		
		#region ForeignKey Properties
		
		/// <summary>
		/// Returns a User ActiveRecord object related to this UserProfile
		/// 
		/// </summary>
		public LMSData.User User
		{
			get { return LMSData.User.FetchByID(this.UserID); }

			set { SetColumnValue("UserID", value.UserID); }

		}

		
		
		#endregion
		
		
		
		//no ManyToMany tables defined (0)
		
		#region ObjectDataSource support
		
		
		/// <summary>
		/// Inserts a record, can be used with the Object Data Source
		/// </summary>
		public static void Insert(int varUserID,string varFirstName,string varMiddleName,string varLastName,string varAddress,string varCity,string varStateProvince,string varCountry,string varPostalCode,string varTitle,string varJobCode,string varCostCenter,string varUniqueID,string varTelephone,string varCellPhone,string varEmail,DateTime? varLastUpdatedDate,DateTime? varCreatedOn,string varCreatedBy,DateTime? varModifiedOn,string varModifiedBy,bool varIsDeleted)
		{
			UserProfile item = new UserProfile();
			
			item.UserID = varUserID;
			
			item.FirstName = varFirstName;
			
			item.MiddleName = varMiddleName;
			
			item.LastName = varLastName;
			
			item.Address = varAddress;
			
			item.City = varCity;
			
			item.StateProvince = varStateProvince;
			
			item.Country = varCountry;
			
			item.PostalCode = varPostalCode;
			
			item.Title = varTitle;
			
			item.JobCode = varJobCode;
			
			item.CostCenter = varCostCenter;
			
			item.UniqueID = varUniqueID;
			
			item.Telephone = varTelephone;
			
			item.CellPhone = varCellPhone;
			
			item.Email = varEmail;
			
			item.LastUpdatedDate = varLastUpdatedDate;
			
			item.CreatedOn = varCreatedOn;
			
			item.CreatedBy = varCreatedBy;
			
			item.ModifiedOn = varModifiedOn;
			
			item.ModifiedBy = varModifiedBy;
			
			item.IsDeleted = varIsDeleted;
			
		
			if (System.Web.HttpContext.Current != null)
				item.Save(System.Web.HttpContext.Current.User.Identity.Name);
			else
				item.Save(System.Threading.Thread.CurrentPrincipal.Identity.Name);
		}

		
		/// <summary>
		/// Updates a record, can be used with the Object Data Source
		/// </summary>
		public static void Update(int varUserProfileID,int varUserID,string varFirstName,string varMiddleName,string varLastName,string varAddress,string varCity,string varStateProvince,string varCountry,string varPostalCode,string varTitle,string varJobCode,string varCostCenter,string varUniqueID,string varTelephone,string varCellPhone,string varEmail,DateTime? varLastUpdatedDate,DateTime? varCreatedOn,string varCreatedBy,DateTime? varModifiedOn,string varModifiedBy,bool varIsDeleted)
		{
			UserProfile item = new UserProfile();
			
				item.UserProfileID = varUserProfileID;
				
				item.UserID = varUserID;
				
				item.FirstName = varFirstName;
				
				item.MiddleName = varMiddleName;
				
				item.LastName = varLastName;
				
				item.Address = varAddress;
				
				item.City = varCity;
				
				item.StateProvince = varStateProvince;
				
				item.Country = varCountry;
				
				item.PostalCode = varPostalCode;
				
				item.Title = varTitle;
				
				item.JobCode = varJobCode;
				
				item.CostCenter = varCostCenter;
				
				item.UniqueID = varUniqueID;
				
				item.Telephone = varTelephone;
				
				item.CellPhone = varCellPhone;
				
				item.Email = varEmail;
				
				item.LastUpdatedDate = varLastUpdatedDate;
				
				item.CreatedOn = varCreatedOn;
				
				item.CreatedBy = varCreatedBy;
				
				item.ModifiedOn = varModifiedOn;
				
				item.ModifiedBy = varModifiedBy;
				
				item.IsDeleted = varIsDeleted;
				
			item.IsNew = false;
			if (System.Web.HttpContext.Current != null)
				item.Save(System.Web.HttpContext.Current.User.Identity.Name);
			else
				item.Save(System.Threading.Thread.CurrentPrincipal.Identity.Name);
		}

		#endregion
		#region Columns Struct
		public struct Columns
		{
			 public static string UserProfileID = @"UserProfileID";
			 public static string UserID = @"UserID";
			 public static string FirstName = @"FirstName";
			 public static string MiddleName = @"MiddleName";
			 public static string LastName = @"LastName";
			 public static string Address = @"Address";
			 public static string City = @"City";
			 public static string StateProvince = @"StateProvince";
			 public static string Country = @"Country";
			 public static string PostalCode = @"PostalCode";
			 public static string Title = @"Title";
			 public static string JobCode = @"JobCode";
			 public static string CostCenter = @"CostCenter";
			 public static string UniqueID = @"UniqueID";
			 public static string Telephone = @"Telephone";
			 public static string CellPhone = @"CellPhone";
			 public static string Email = @"Email";
			 public static string LastUpdatedDate = @"LastUpdatedDate";
			 public static string CreatedOn = @"CreatedOn";
			 public static string CreatedBy = @"CreatedBy";
			 public static string ModifiedOn = @"ModifiedOn";
			 public static string ModifiedBy = @"ModifiedBy";
			 public static string IsDeleted = @"IsDeleted";
						
		}

		#endregion
	}

}

